<div class="bh-ly-jj-zhuce bh-padT20 bh-content">
		<?php $form = $this->beginWidget('lib.widgets.CActiveFormAdv')?>
			<?php 
				$time = isset($_GET['time']) ? $_GET['time'] : date('Y-m-d');
				$price = $model->items->goods->timePriceObjAttr('price_dealer', $time);
			?>
    		<?php echo $form->hiddenField($model,'items.related_id')?>
    		<?php echo $form->hiddenField($model,'items.goods_id')?>
    		<?php echo $form->hiddenField($model,'items.provider_id')?>
    		<?php echo $form->hiddenField($model,'items.dealer_id')?>
    		<?php echo $form->hiddenField($model,'items.item_price',array('id'=>'price','value'=>$price))?>
    		<?php echo $form->hiddenField($model,'addon.departure_time',array('value'=>$time))?>
		<div class="bh-page-index-jj">
			<div class="bh-zhhmm-xf">
				<div class="bh-xf-yuding bh-padB30">
					<ul>
						<li>
							<span class="bh-strong">去程航班：</span>
							<span>
								<b><?php echo CUtilHelper::date()->changeFormat($time,'m月d日').CUtilHelper::date()->changeFormat(CHtml::value($model, 'items.goods.profile.departure_time'),'H:i')?>起飞</b>
								<span class="bh-strong"><?php echo CHtml::value($model, 'items.goods.profile.airlines')?>  <?php echo CHtml::value($model, 'items.goods.profile.aircraft_type')?> (<?php echo CHtml::value($model, 'items.goods.profile.flight')?> <?php echo Yii::app()->enum->lookUp('goods.flightAccommodation',CHtml::value($model, 'items.goods.profile.accommodation'))?>)</span>
								<?php echo Yii::app()->enum->lookup('district', CHtml::value($model, 'items.goods.profile.departure_province'))?>（<?php echo CHtml::value($model, 'items.goods.profile.departure_airport')?>）- <?php echo Yii::app()->enum->lookup('district', CHtml::value($model, 'items.goods.profile.arrival_province'))?>
							</span>
						</li>
						<li>
                        	<span class="bh-strong">乘机人数：</span>
                        	<span>
	                        	<?php echo $form->dropDownList($model, 'items.item_num', Yii::app()->enum->options('num',false),array('id' => 'item-num'))?>  张
								<?php echo $form->error($model, 'items.item_num');?>
							</span>
                        </li>
						<li class="xf-hanggao"><span class="bh-fr"><?php echo $price?>*<label id='num'>1</label></span><span><b>行程费用：</b> </span></li>
						<li class="xf-hengxian"></li>
						<li class="xf-hengxian2"><span class="bh-fr">总计：<b><label id='money'><?php echo CHtml::value($model, 'items.item_price')?></label>元</b></span></li>
					</ul>
				</div>
				<div class="bh-qupiaoxinxi" id='jipiao'>
				<?php echo $this->renderPartial('application.views.partials.order.schedule');?>
					<div id='copy-content'>
	                    <div class="bh-xf-biankuang">
	                    	<h1>第1位乘机人</h1>
	                        <table>
	                            <tr height="40">
	                                <td align="right"><?php echo $form->labelEx($model,'travelers.1.name')?>：</td>
	                                <td colspan="2">
	                                	<?php echo $form->textField($model,'travelers.1.name',array(
											'class'=>'bh-textW',
										))?>
										<?php echo $form->error($model, 'travelers.1.name')?>
	                                </td>
	                            </tr>
	                            <tr height="40">
	                                <td align="right"><?php echo $form->labelEx($model,'travelers.1.idcard')?>：</td>
	                                <td colspan="2">
										<?php echo $form->textField($model,'travelers.1.idcard',array(
											'class'=>'bh-textW',
										))?>
										<?php echo $form->error($model, 'travelers.1.idcard')?>
									</td>
	                            </tr>
	                        </table>
	                    </div>
                    </div>
                    <div class="bh-xf-biankuang bh-mtop10">
                        <table>
                        	<tr height="40">
								<th align="right"><?php echo $form->labelEx($model,'pay_type')?>：</th>
								<td  colspan="2"> <?php echo $form->dropDownList($model, 'pay_type',Yii::app()->enum->options('order.payType'))?>
									<?php echo $form->error($model, 'pay_type');?>
								</td>
							</tr>
                            <tr height="40">
                                <td align="right"><?php echo $form->labelEx($model,'receiverInfo.receiver')?>：</td>
                                <td colspan="2">
									<?php echo $form->textField($model,'receiverInfo.receiver',array(
										'class'=>'bh-textW',
									))?>
									<?php echo $form->error($model, 'receiverInfo.receiver')?>
								</td>
                            </tr>
                            <tr height="40">
                                <td align="right"><?php echo $form->labelEx($model,'receiverInfo.mobile')?>：</td>
                                <td colspan="2">
									<?php echo $form->textField($model,'receiverInfo.mobile',array(
										'class'=>'bh-textW',
									))?>
									<?php echo $form->error($model, 'receiverInfo.mobile')?>
								</td>
                            </tr>
                            <tr height="40">
                                <td align="right"><?php echo $form->labelEx($model,'receiverInfo.email')?>：</td>
                                <td colspan="2">
                                	<?php echo $form->textField($model,'receiverInfo.email',array(
										'class'=>'bh-textW',
									))?>
									<?php echo $form->error($model, 'receiverInfo.email')?>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="bh-ly-jj-for01">
                    	<form>
                        	<input type="submit" value="提交订单"class="bh-ly-jj-agree_sub bh-mTop20 bh-strong" name="agree_submit" style="margin-left:318px" />
                        </form>
                    </div>
                    <div class="bh-space"></div>
				</div>
			</div>
		</div>
		<div class="bh-space"></div>
		<?php $this->endWidget();?>
	</div>
	
<div class="bh-xf-biankuang bh-mtop10 copy-input" style='display:none' id='copy'>
	<h1>第{num}位乘机人</h1>
	<table>
		<tr height="40">
			<td align="right"><?php echo $form->labelEx($model,'travelers.attrId.name')?>：</td>
			<td colspan="2">
				<?php echo $form->textField($model,'travelers.attrId.name',array(
					'class'=>'bh-textW',
				))?>
				<?php echo $form->error($model, 'travelers.attrId.name')?>
			</td>
		</tr>
		<tr height="40">
			<td align="right"><?php echo $form->labelEx($model,'travelers.attrId.idcard')?>：</td>
			<td colspan="2">
				<?php echo $form->textField($model,'travelers.attrId.idcard',array(
					'class'=>'bh-textW',
				))?>
				<?php echo $form->error($model, 'travelers.attrId.idcard')?>
			</td>
		</tr>
	</table>
</div>
<script>
$('#item-num').live('change',function() {
	$('#copy-content .copy-input').remove();
    $('#num').html($(this).val());
	$('#money').html(myPriceNum($('#price').val())*$(this).val());
	for(i=0; i<$(this).val()-1; i++) {
		$ele = $('#copy').clone();
		id = 'N-'+new Date().getTime()+Math.floor(Math.random()*10000);
		html = '<div class="bh-xf-biankuang bh-mtop10 copy-input">'+$ele.html().replace(/attrId/g, id).replace(/{num}/,i+2)+'</div>';
		$('#copy-content').append(html);
		$ele.show();
	}
});
$('#item-num').change();
</script>